// 构建服务器
const express = require('express');
//解析,用req.body获取post参数
const bodyParser = require('body-parser');
// 导入跨域的包
const cors = require('cors')
// 导入跨域的包
// 跨域中间件
const app = new express()
// 第三方中间件,可以跨域
app.use(cors())
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

app.post('/post', (request, response) => {
  console.log(request.query)
  console.log(request.body)
  console.log(request.headers);
  response.send("post---144444")
})
app.get('/get', (request, response) => {
  console.log(request.query)
  console.log(request.headers);
  response.send("get---22222")
})

app.listen(90, () => {
  console.log('http://localhost:90 started. Location: ')
})